package com.zr.sms.daoimpl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import com.zr.sms.dao.RoleDao;
import com.zr.sms.util.JDBCUtil;


public class RoleDaoImpl implements RoleDao{

		public String selectRfuncsByRid(int rid) {
			Connection con=null;
			PreparedStatement stmt=null;
			ResultSet rs=null;
			String rfuncs=null;
			con=JDBCUtil.getConnection();
			StringBuffer sql=new StringBuffer("select rfuncs from role where rid=?");
			try {
				stmt=con.prepareStatement(sql.toString());
				stmt.setInt(1, rid);
				rs=stmt.executeQuery();
				if(rs.next()){
					rfuncs=rs.getString("rfuncs");
				}
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			return rfuncs;
	}

}
